﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DemountCIM.Framework.DataBase.Table
{
    [SugarTable("tb_parameter")]
    public class TbParameter
    {
        [SugarColumn(ColumnName = "id", IsIdentity = true, IsPrimaryKey = true)]
        public int Id { get; set; }

        /// <summary>
        /// 模组ID
        /// </summary>
        [SugarColumn(ColumnName = "run_id")]
        public int RunId { get; set; }

        /// <summary>
        /// 参数Key
        /// </summary>
        [SugarColumn(ColumnName = "param_key", ColumnDataType = "varchar(50)")]
        public string ParamKey { get; set; }

        /// <summary>
        /// 参数名称
        /// </summary>
        [SugarColumn(ColumnName = "param_name", ColumnDataType = "varchar(50)")]
        public string ParamName { get; set; }

        /// <summary>
        /// 参数值
        /// </summary>
        [SugarColumn(ColumnName = "param_value", ColumnDataType = "varchar(50)", IsNullable = true)]
        public string ParamValue { get; set; }

        /// <summary>
        /// 对参数的描述解释
        /// </summary>
        [SugarColumn(ColumnName = "description", ColumnDataType = "varchar(200)", IsNullable = true)]
        public string Description { get; set; }

        /// <summary>
        /// 参数类型
        /// </summary>
        [SugarColumn(ColumnName = "param_type", ColumnDataType = "int")]
        public ParamType ParamType { get; set; }

        /// <summary>
        /// 用户权限
        /// </summary>
        [SugarColumn(ColumnName = "user_level", ColumnDataType = "int")]
        public UserLevel UserLevel { get; set; }

        /// <summary>
        /// 只读
        /// </summary>
        [SugarColumn(ColumnName = "readonly")]
        public bool ReadOnly { get; set; }

        /// <summary>
        /// 可见
        /// </summary>
        [SugarColumn(ColumnName = "visible")]
        public bool Visible { get; set; }

        [SugarColumn(ColumnName = "sort")]
        public int Sort { get; set; }
    }

    public enum ParamType
    {
        Int,
        Bool,
        String
    }
}
